package com.inspinia.message.common.model;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.util.concurrent.GlobalEventExecutor;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedDeque;

/**
 * 常量
 *
 * @author Veblen*/
public class MessageConstant {

    /**
     * 存放用户对应的ChannelHandlerContext
     */
    public static Map<String, ConcurrentLinkedDeque<ChannelHandlerContext>> pushCtxMap = new ConcurrentHashMap<String, ConcurrentLinkedDeque<ChannelHandlerContext>>() ;

    /**
     * 存放某一类的channel
     */
    public static ChannelGroup ChannelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);

    /**
     * 通知类型：广播
     */
    public static final String PUBLISH_TYPE_BROADCAST = "broadcast";

    /**
     * 通知类型：主题
     */
    public static final String PUBLISH_TYPE_TOPICS = "topics";

    /**
     * 通知类型：点对点
     */
    public static final String PUBLISH_TYPE_CLIENTS = "clients";

}
